Filter hook 'rest_{$this->post_type}_trashable'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 1029

Description

Filters whether a post is trashable. The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. Possible hook names include: - `rest_post_trashable` - `rest_page_trashable` - `rest_attachment_trashable` Pass false to disable Trash support for the post.

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1029

Parameters

Type Name Description
bool $supports_trash Whether the post type support trashing.
WP_Post $post The Post object being considered for trashing support.

PHP Doc

/**
		 * Filters whether a post is trashable.
		 *
		 * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
		 *
		 * Possible hook names include:
		 *
		 *  - `rest_post_trashable`
		 *  - `rest_page_trashable`
		 *  - `rest_attachment_trashable`
		 *
		 * Pass false to disable Trash support for the post.
		 *
		 * @since 4.7.0
		 *
		 * @param bool    $supports_trash Whether the post type support trashing.
		 * @param WP_Post $post           The Post object being considered for trashing support.
		 */